package com.markyao.mq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MqSender {
    //mq发送端,通过绑定好的秒杀队列的routingKey发送Msg订单信息
    @Autowired
    RabbitTemplate rabbitTemplate;
    public void sendSeckillMessage(MiaoshaMessage message) {
        rabbitTemplate.convertAndSend("amq.direct", "miaosha", message);
    }
}
